require_relative '../spec_helper'

$foo = 1

def m
  $foo
end

class Foo
  def m
    $foo
  end

  def self.m
    $foo
  end
end

describe 'globals' do
  it 'can be set and returned' do
    r = $foo
    r.should == 1
    m.should == 1
    Foo.new.m.should == 1
    Foo.m.should == 1
  end
end
